<form id="frmProductCategory" method="post">
	<div style="width: 40%; float: left;">
		<div class="row">
			<label for="name">Tên thể loại</label>
			<input style="width: 200px;" type="text" name="name" id="name" size="30" value="<?php echo $this->pCategory->name;?>"/>
		</div>
		<div class="row">
			<label for="slug">Slug (hiển thị trên url)</label>
			<input style="width: 200px;" type="text" name="slug" id="slug" size="30" value="<?php echo $this->pCategory->slug;?>"/>
		</div>
		<div class="row">
			<label for="level">Cấp độ</label>
			<select style="width: 200px;" name="level" id="level">
				<option value="1" <?php echo ($this->pCategory->level == 1)? "selected='selected'" : "";?>>Cấp 1</option>
				<option value="2" <?php echo ($this->pCategory->level == 2)? "selected='selected'" : "";?>>Cấp 2</option>
			</select>
		</div>
		<div class="row">
			<label for="parent_id">Tên thể loại</label>
			<select style="width: 200px;" name="parent_id" id="parent_id">
				<option value="0">Lựa chọn thể loại cha</option>
				<?php 
				foreach ($this->arrPCategoriesLv1 as $pCategoryLv1){
					if($this->pCategory->parent_id == $pCategoryLv1->id){
						echo "<option selected= 'selected' value='".$pCategoryLv1->id."'>".$pCategoryLv1->name."</option>";
					}else{
						echo "<option value='".$pCategoryLv1->id."'>".$pCategoryLv1->name."</option>";
					}
				}?>
			</select>
		</div>
		<div class="row">
			<label for="ad_image">Ảnh quảng cáo đính kèm (720px * 60px)</label>
			<input style="width: 200px;" type="text" name="ad_image" id="ad_image" size="30" value="<?php echo $this->pCategory->ad_image;?>"/>
			<input class="button" type="button" value="Chọn Ảnh" onclick="BrowseServer();"/>
		</div>
		<div class="row showed_on_hp" >
			<label for="showed_on_hp">Cho phép hiện thị tại trang chủ</label>
			<input type="radio" name="showed_on_hp" value="1" <?php echo ($this->pCategory->showed_on_hp == 1)? "checked='checked'" : "";?>/> Có 
			<input type="radio" name="showed_on_hp" value="0" <?php echo ($this->pCategory->showed_on_hp == 0)? "checked='checked'" : "";?>/> Không
		</div>
		<div class="row">
			<label for="page_title">Tiêu đề trang (thẻ title)</label>
			<input style="width: 350px;" type="text" name="page_title" id="page_title" size="30" value="<?php echo $this->pCategory->page_title;?>"/>
		</div>
		<div class="row">
			<label for="page_description">Mô tả trang (thẻ description)</label>
			<textarea style="width: 350px; height:100px;" name="page_description" id="page_description"><?php echo $this->pCategory->page_description;?></textarea>
		</div>
		<div class="row">
			<label for="tag">Tag (thẻ keyword)</label>
			<input style="width: 350px;" type="text" name="tag" id="tag" size="30" value="<?php echo $this->pCategory->tag;?>"/>
		</div>
		<fieldset>
			<legend>Chọn bộ lọc cho thể loại</legend>
			<ul>
				<?php
					foreach($this->arrFilters as $filter){
						echo "<li>";
						if(isset($this->pCategory) && in_array($filter->id, Helper_Model::GetColumnsValues('cat_filter', 'filter_id', 'cat_id ='.$this->pCategory->id))){
							echo "<input checked='checked' type='checkbox' name='filter_id[]' value='".$filter->id."'/>";
						}else{
							echo "<input type='checkbox' name='filter_id[]' value='".$filter->id."'/>";
						}
						echo "<label>".$filter->name."</label>";
						echo "</li>";
					}
				?>
			</ul>
		</fieldset>
		<div class="row">
			<input class="button" type="submit" value="Lưu"/>
			<input class="button" type="reset" value="Làm lại"/>
		</div>
	</div>
</form>